import pytest


@pytest.mark.run(order=2)
def test_d():
    print("---test_d")
    pass


@pytest.mark.dependency(depends=["test_a"])
# @pytest.mark.dependency(depends=["test_a","test_c"])  # 可以依赖多个
def test_b():
    print("---test_b")
    pass


@pytest.mark.xfail(reason="预期失败")
def test_a():
    print("---test_a")
    assert 1 == 2


@pytest.mark.run(order=1)
def test_c():
    print("---test_c")
    pass

if __name__ == '__main__':
    pytest.main()